package com.itheima.d5_genericity;

import java.util.ArrayList;

public class Test3 {
    public static void main(String[] args) {
        Benz benz = new Benz();
        ArrayList<Benz> benzs = new ArrayList<>();
        benzs.add(benz);

        BMW bmw = new BMW();
        ArrayList<BMW> bmws = new ArrayList<>();
        bmws.add(bmw);
        go(bmws);
    }
    public static void  go(ArrayList<? extends Car> cars){
    }
}

class Car {

}
class Benz extends  Car{}
class BMW extends  Car{}